import { Controller, UseGuards } from '@nestjs/common';
import { Crud } from 'nestjs-mongoose-crud';
import { InjectModel } from 'nestjs-typegoose';
import { ModelType } from '@typegoose/typegoose/lib/types';
import { ApiUseTags, ApiBearerAuth } from '@nestjs/swagger';
import { Comment } from '@lib/db/models/comment.model'
import { AuthGuard } from '@nestjs/passport';

@Controller('comments')
@Crud({
  model: Comment,
  routes: {
    find: {
      populate: ['order']
    }
  }
})
@ApiUseTags('商品评论')
@UseGuards(AuthGuard('jwt'))
@ApiBearerAuth()
export class CommentsController {
  constructor(
    @InjectModel(Comment) private readonly model: ModelType<Comment>
  ) {
  }
}
